array data structure problems